package com.itheima.controller;

import com.itheima.service.db.AnalysisByDayService;
import com.itheima.vo.AnalysisSummaryVo;
import com.itheima.vo.AnalysisTableVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/analysisByDay")
public class AnalysisByDayController {

    @Autowired
    private AnalysisByDayService analysisByDayService;

    @GetMapping("/analysis")
    public void analysis() {
        analysisByDayService.analysis();
    }

    @GetMapping("/summary")
    public AnalysisSummaryVo summary() {
        return analysisByDayService.summary();
    }

    @GetMapping("/summaryTable")
    public AnalysisTableVo summaryTable(Long sd, Long ed, String type) {
        return analysisByDayService.summaryTable(sd, ed, type);
    }
}
